package com.ikas.ai.server.module.flow.service;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ikas.ai.server.module.flow.dao.FlowLogDAO;
import com.ikas.ai.server.module.flow.model.FlowLog;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Description: 流程日志service
 * @Author: qi.yilai
 * @Date: 2023/2/1 17:04
 * @Version: 1.0.0
 **/
@Service
public class FlowLogService extends ServiceImpl<FlowLogDAO, FlowLog> {

    /**
     * 根据流程实例id获取日志
     *
     * @param flowInstanceId
     * @return
     */
    public List<FlowLog> getFlowLogByFlowId(Long flowInstanceId) {
        LambdaQueryWrapper<FlowLog> lambdaQueryWrapper = new LambdaQueryWrapper<>();
        lambdaQueryWrapper.eq(FlowLog::getFlowInstanceId, flowInstanceId);
        return list(lambdaQueryWrapper);
    }

}
